package com.tnstart.android.control.light.fragments;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.Toast;

import com.tnstart.android.control.R;
import com.tnstart.android.control.light.adapter.AreaAdapter;
import com.tnstart.android.control.light.bean.SampleItem;

public class AreaListFragment extends BaseListFragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        setListLayoutId(R.layout.light_area_list);
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public AreaAdapter adapterBuilder() {
        return new AreaAdapter(getActivity());
    }

    public void processSelection(ListView lv, View v, int position, long id){
        Toast.makeText(this.getActivity(),"默认Toast样式",
                Toast.LENGTH_SHORT).show();

    }

    @Override
    public void doReloadData() {
        for (int i = 0; i < 20; i++) {
            getAdapter().add(new SampleItem("Sample List", android.R.drawable.ic_menu_search, 1));
        }
    }


}
